package com.woniu.platform.contorller;

import com.woniu.aop.OperationLogAnnotation;
import com.woniu.customer.entity.vo.CustomerVO;
import com.woniu.platform.entity.vo.PlatformCustomerAuditRecordVO;
import com.woniu.platform.service.PlatformCustomerService;
import com.woniu.util.utils.HttpResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("PlatformCustomer")
public class PlatformCustomerController {
    @Autowired
    private PlatformCustomerService platformCustomerService;

    /**
     * 通过属性查询待审核用户
     * @param customerVO
     * @return
     */
    @PostMapping("selectCustomerShouldAudit")
    @OperationLogAnnotation(operModul = "平台-查询待审核客户",operType = "查询",operDesc = "根据属性查询客户")//操作日志注解
    HttpResult<?> selectCustomerShouldAudit(CustomerVO customerVO){
        return platformCustomerService.selectCustomerShouldAudit(customerVO);
    }

    /**
     * 通过属性查找客户
     * @param customerVO
     * @return
     */
    @PostMapping("selectCustomer")
    @OperationLogAnnotation(operModul = "平台-查询客户",operType = "查询",operDesc = "根据属性查询客户")//操作日志注解
    HttpResult<?> selectCustomer(CustomerVO customerVO){
        return platformCustomerService.selectCustomer(customerVO);
    }

    /**
     * 审核用户
     * 生成审核记录
     * @param result
     * @param customerId
     * @return
     */
    @PostMapping("customerAudit")
    @OperationLogAnnotation(operModul = "平台-审核用户",operType = "新增、修改",operDesc = "修改用户审核状态、生成审核记录")//操作日志注解
    HttpResult<?> customerAudit(Integer result, String customerId){
        return platformCustomerService.customerAudit(result,customerId);
    }

    /**
     * 通过属性查找用户审核记录
     * @param platformCustomerAuditRecordVO
     * @return
     */
    @PostMapping("selectCustomerAuditRecord")
    @OperationLogAnnotation(operModul = "平台-查看审核记录",operType = "查询",operDesc = "根据属性查询审核记录")//操作日志注解
    HttpResult<?> selectCustomerAuditRecord(PlatformCustomerAuditRecordVO platformCustomerAuditRecordVO){
        return platformCustomerService.selectCustomerAuditRecord(platformCustomerAuditRecordVO);
    }

}
